<div class="page-content">
	<div class="row">
		<div class="col-xs-12"> 
	
			<div id="alert_box_table"></div>

			<div class="row">

				<div class="action-buttons" style="float:right;">
					<button ng-click="show()" class="btn btn-sm btn-success" >
						<i class="icon-plus bigger-130"></i>
						<span class="bigger-110 no-text-shadow">新增</span>
					</button>
					<button ng-click="del_list()" class="btn btn-sm btn-danger" id="btn_del" data-loading-text="正在提交,请稍候...">
						<i class="icon-trash bigger-130"></i>
						<span class="bigger-110 no-text-shadow">删除</span>
					</button>

				</div>
			</div>
			<div class="space-4"></div>
			<div class="table-responsive">
				<table id="grid-table" class="table table-striped table-bordered table-hover dataTable" aria-describedby="sample-table-2_info">
					<thead>
						<tr>
							<th class="center">
								<label>
									<input ng-model="allChecked" ng-change="checkAll(allChecked)" type="checkbox" class="ace">
									<span class="lbl"></span>
								</label>
							</th>
							<th class="center">标题</th>
							<th class="center">图片</th>
					
							<th class="center">创建时间</th>
							<th class="center" width="100">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr class="center"  data-row-style="{{item.activated}}" ng-repeat="item in ad_list" >
							<td class="center" width="50">
								<label>
									<input ng-model="item.$checked" type="checkbox" class="ace">
									<span class="lbl"></span>
								</label>
							</td>
							<td width="20%">{{item.title}}</td>
							<td width="20%"><img src="..{{item.image}}" style="height:30px;"></td>
							
							<td width="20%">{{item.create_datetime}}</td>

							
							<td width="12%">
								<div class="action-buttons">
									<a class="green" href="javascript:void(0);" title="编辑" ng-click="edit_accounts(item)">
										<i class="icon-pencil bigger-130"></i>
									</a>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>

			

			<div id="table-list" class="widget-box transparent" ng-show="is_show">
				<div class="widget-header widget-header-flat widget-header-small"><h5><i class="icon-pencil"></i>{{fromtitle}}商户广告</h5>
				</div>
				<div class="widget-body  col-sm-12 col-xs-12">
					<div class="widget-main">
						<form name="userForm" id="userForm" novalidate="" role="form"> 
							<div class="form-horizontal">
								
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right margintop5" for="form-field-1"> 
										<i class="icon-asterisk light-red smaller-60 middle"></i>&nbsp;标题： 
									</label>
									<div class="col-sm-9">
										<div class="input-group col-xs-10 col-sm-6 ">
											<input type="text" id="title" name="title" ng-model="ad.title" class="form-control" ng-blur="titledisplay = {'display': !userForm.title.$invalid ? 'none' : 'block'}" ng-focus="titledisplay={'display':'block'}" length-unique="2,12" required/>
										</div>
										<div class="col-sm-1 col-xs-12" style="position: relative;">
											<div class="popover right" id="titleTip" tip-location="-20px" ng-style="titledisplay" style="min-width:270px">
												<div class="arrow"></div>
												<div class="popover-content">
													<div ng-class="{'default black1':userForm.title.$pristine, 'no red1':userForm.title.$error.unique, 'yes':!userForm.title.$error.unique}" class="msg_tips">标题的长度范围为[2-12]个字符</div>
													<div ng-class="{'default':userForm.title.$pristine, 'no red1':userForm.title.$error.required, 'yes':!userForm.title.$error.required}" class="msg_tips">标题不能空</div>
												</div>
										    </div>			
															
										</div>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-3 control-label no-padding-right margintop5" for="form-field-1"> 
										广告图片： 
									</label>
									<div class="col-sm-9">
										<div class="input-group col-xs-10 col-sm-6 " ng-mouseleave="imagedisplay = {'display': 'none'}" ng-mouseover="imagedisplay={'display':'block'}">
											<input type="file" nv-file-select="" uploader="uploader" options="{formData:{'type':'merchant_ad', 'imagename':ad.image ? ad.image : ''} }" class="form-control"  data-file-input />
											<div ng-show="is_upload" class="progress progress-striped active " data-percent="{{progress}}%"><div class="progress-bar" ng-style="{ 'width': progress + '%' }"></div></div>
											<img ng-show="ad.image" ng-src="{{ad.image}}"  class="img-thumbnail col-xs-12 col-sm-12">
											<div class="space-4"></div>
											<div id="alert_box_image"></div>
										</div>
										<label class="inline" tipbr="">
											<div style="position: relative; ">
												<div class="popover right" id="imageTip" tip-location="-40px" ng-style="imagedisplay" style="min-width: 350px; top: -50px; display: none;">
													<div class="arrow"></div>
													<div class="popover-content">
														<div class="msg_tips default">图片规格为450 * 680。</div>
														<div class="msg_tips default">大小为2MB，格式为：jpg，png，gif</div>
														<div class="msg_tips default">该图片显示在认证页</div>
													</div>
											    </div>			
																
											</div>
										</label>
									</div>
								</div>
							
							
							
							

								<div id="alert_box"></div>
								<div class="clearfix form-actions">
									<div class="col-md-offset-3 col-md-9 col-sm-9">
										<button id="save" class="col-sm-2 btn btn-success" ng-disabled='userForm.$invalid' data-loading-text="正在提交,请稍候..." type="button" ng-click="save()">
											<i class="icon-save bigger-110"></i>
										 	<span id="submitbutton">保存</span>
										</button>
										<button class="col-sm-2 btn btn-default left10" type="button" ng-click="is_show=false">
											<i class="icon-reply bigger-110"></i>
										 	<span id="submitbutton">取消</span>
										</button>
									</div>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>	
			
		</div>
	</div>
</div>

